/******************************************************************************/
/* File: udpTrafficSender.h                                                   */
/******************************************************************************/

#ifndef UDPTRAFFICSENDER_H
#define UDPTRAFFICSENDER_H

#include <sys/types.h>
#include "socketClass.h"
#include "thread.h"
#include "dataStore.h"
#include "utilClass.h"

class UDPTrafficSender : public Thread {
    
public:
    UDPTrafficSender(UDPConnectedSocket *pucs, ThreadConf *ptc);
    ~UDPTrafficSender();

    int SendPacket(int iPacketID, int length);
    
    void UploadReport(double begin, double end, int64_t transfer, double bandwidth, int64_t packets);
    double CheckThrottleAndDelay(int64_t iBytes, double fTimeUsecs);
    
    void ExitCleanUp();
    virtual void Run();
protected:
    UDPConnectedSocket *pUdpSock;
    ThreadConf *pThreadConf;
    
    char *pSendBuf;
    int iSendRate;
};

#endif

/******************************************************************************/
/* End File: udpTrafficSender.h                                               */
/******************************************************************************/